/***************************************************************************\
 * The Mattise Kernel														*
 * Copyright 2007 Matthew Iselin											*
 * Licensed under the GPL													*
 *																			*
 * dma.h																	*
 *																			*
 * Handles DMA requests, simple as that										*
 *																			*
\***************************************************************************/

#ifndef DMA_H
#define DMA_H

// a DMA block
struct dmablock
{
	uchar_t page;
	uint_t off;
	uint_t length;
};

// DMA:
// handles all dma requests
// used by creating an instance of this class
// and then calling its functions
class DMA
{
	// public data
	public:
		
		// constructor
		DMA();
		
		// destructor
		~DMA();
		
		// sets the channel to use
		void SetChannel( uint_t chan );
		
		// sets the mode to use
		void SetMode( uint_t mode );
		
		// starts a request
		void StartDMA();
		
		// gets the block of data
		void GetData( char* dat );
		
	// private data
	private:
		
		// the dma block for each request
		struct dmablock blk;
};

#endif
